

package edu.yzu.testspringboot002.po.dto;


import com.fasterxml.jackson.annotation.JsonProperty;
import edu.yzu.testspringboot002.common.group.AddGroup;
import edu.yzu.testspringboot002.common.group.DefaultGroup;
import edu.yzu.testspringboot002.common.group.UpdateGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Null;
import lombok.Data;
import org.hibernate.validator.constraints.Range;


import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 用户管理
 *
 * @author Mark sunlightcs@gmail.com
 * @since 1.0.0
 */
@Data
@ApiModel(value = "用户管理")
public class SysUserDTO implements Serializable {
    private static final long serialVersionUID = 1L;

	@ApiModelProperty(value = "id")
	@Null(message="id为空", groups = AddGroup.class)
	@NotNull(message="id不能为空", groups = UpdateGroup.class)
	private Long id;

	@ApiModelProperty(value = "用户名", required = true)
	@NotBlank(message="用户名不能为空", groups = DefaultGroup.class)
	private String username;

	@ApiModelProperty(value = "密码")
	@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
	@NotBlank(message="{sysuser.password.require}", groups = AddGroup.class)
	private String password;

	@ApiModelProperty(value = "姓名", required = true)
	@NotBlank(message="{sysuser.realname.require}", groups = DefaultGroup.class)
	private String realName;

	@ApiModelProperty(value = "头像")
	private String headUrl;

	@ApiModelProperty(value = "性别   0：男   1：女    2：保密", required = true)
	@Range(min=0, max=2, message = "性别不能为空", groups = DefaultGroup.class)
	private Integer gender;

	@ApiModelProperty(value = "邮箱")
	@Email(message="邮箱不能为空", groups = DefaultGroup.class)
	private String email;

	@ApiModelProperty(value = "手机号")
	private String mobile;

	@ApiModelProperty(value = "部门ID", required = true)
	@NotNull(message="{sysuser.deptId.require}", groups = DefaultGroup.class)
	private Long deptId;

	@ApiModelProperty(value = "状态  0：停用    1：正常", required = true)
	@Range(min=0, max=1, message = "状态不能为空", groups = DefaultGroup.class)
	private Integer status;

	@ApiModelProperty(value = "创建时间")
	@JsonProperty(access = JsonProperty.Access.READ_ONLY)
	private Date createDate;

	@ApiModelProperty(value = "超级管理员   0：否   1：是")
	@JsonProperty(access = JsonProperty.Access.READ_ONLY)
	private Integer superAdmin;

	@ApiModelProperty(value = "超级租户   0：否   1：是")
	@JsonProperty(access = JsonProperty.Access.READ_ONLY)
	private Integer superTenant;

	@ApiModelProperty(value = "租户代码")
	private Long tenantCode;

	@ApiModelProperty(value = "角色ID列表")
	@NotNull(message = "角色信息不能为空", groups = DefaultGroup.class)
	private List<Long> roleIdList;

	@ApiModelProperty(value = "部门名称")
	private String deptName;

	@ApiModelProperty(value = "租户名称")
	private String tenantName;

	@ApiModelProperty(value = "身份证号")
	private String idCard;

	@ApiModelProperty(value = "所属机构")
	private Long affiliateId;

	@ApiModelProperty(value = "备注")
	private String remarks;

	@ApiModelProperty(value = "登陆时间")
	private Date loginTime;

	@ApiModelProperty(value = "登陆次数")
	private Integer retry;
	
	@ApiModelProperty(value = "工号")
	private String workNo;

	@ApiModelProperty(value = "被锁状态  0：正常    1：被锁", required = true)
	private Integer locked;

	@ApiModelProperty(value = "角色名称列表")
	private List<String> roleNameList;
}